PAK.EXE (c) 1998 Richard Smithies Any problems, suggestions or comments, please e-mail richsmithies@hotmail.com This is the first (beta) release (27-March-1998) Description: The PAK program enables you to combine several files into a single file which can be uploaded to the Net Yaroze console. In addition, some of the files can also be compressed, therefore saving upload time and memory space. Use: A list of the files to be stored must be created. This is a plain text file. Each file to be stored needs two lines. The first line is the filename, and the second is the reference name. The reference name is the name you will use to reference this file from your source code. Files are compressed using RLE as default. To stop compression, place a hash (#) symbol at the start of the filename. Blank lines and lines beginning with a semicolon (;) are ignored. To create the pak file, use the following command line PAK pakfile data Where pakfile is the name of the text file containing your file lists, and data is the name of the output file. Two output files are created, data.c and data.pak. You must include data.c in your source code as this contains all the reference indexes and start address of the pak header table. The actual data is in data.pak. Use the provided library pak.h for functions to access the files stored in the pak. References to the data files must be done using the symbol (_PAK_mydata_INDEX) where mydata is the reference used. Do not use the other symbols included in the data.c file as these are only included for backwards compatability with some of my projects, and may be removed on future versions. See the pakexample.zip file for a practical example. The file list is called 'pakfile' in this example. (i.e. to repak use PAK pakfile data) Function list: There are six functions. u_long getpaklength(int index) Returns the length of a file in the PAK. u_long getpakaddress(int index) Returns the address of a file in the PAK. void unpak(int index, void *dest) Unpacks file index to address specified by dest. void unpakRLE(void *source, void *dest, u_long length) The actual uncompression routine. You should not need to call this directly. void TransferTIM(int index) Unpaks a TIM file to the framebuffer. void TransferTextures(u_long *tim) tim is the address of the .TIM file minus the ID (i.e. add 4 bytes) Notes & Limitations: It will not compress files larger than about 120Kbytes. Make sure to re-compile your source after pakking. To do: Lots of things, like increasing the compression file size limit. Adding new compression routines All this is down to finding the time to improve it. It works fine for me at the moment. The next most important step would probably be LZW compression or something similar, however I can't find any reasonable explanations of this method. If you have any further suggestions, or have found this program useful and would like to see future updates etc.. then please let me know.